﻿CREATE TRIGGER [acms].[PostPosition_Trg_Insert]
ON [acms].[PostPositions]
FOR INSERT
AS 
BEGIN
	SET NOCOUNT ON

	Update [acms].[PostPositions]
	Set [ParentPath] = acms.GetPostParentPath([Inserted].PostId, [Inserted].PublishDate)
		, ParentSequence = acms.GetPostParentSequence([Inserted].PostId, [Inserted].PublishDate)
	From
		[acms].[PostPositions]
		inner join [Inserted] on [acms].[PostPositions].Id = [Inserted].Id
 END
;


